package cn.xfdzx.android.apps.shop.contract;

import java.util.Map;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.BaseObjectBean;
import cn.xfdzx.android.apps.shop.bean.ConfirmGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HomeSearchXFDGoodBeen;
import cn.xfdzx.android.apps.shop.bean.MoreGoodsBean;
import cn.xfdzx.android.apps.shop.bean.ShopCarListBeen;
import cn.xfdzx.android.apps.shop.bean.ShopGoodListBeen;
import cn.xfdzx.android.apps.shop.bean.ShopSearchBeen;
import cn.xfdzx.android.apps.shop.bean.StoreInfoBeen;
import cn.xfdzx.android.apps.shop.bean.XFDGoodsDetailsBeen;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */

public interface ShopSearchContract {
    interface Model {
        Flowable<ShopSearchBeen> initSearchData(String lng, String lat,String sid, String page, String limit,
                                                String index_status, String is_store, String store_id, String keyword,
                                                String priceOrder, String salesOrder, String news);

        Flowable<ConfirmGoodBeen> addCar(String is_new, String uniqueId, String productId, String cartNum);
        Flowable<ShopCarListBeen> shopCarList(String store_id, String index_status);
        Flowable<BaseObjectBean> updateCarNum(String id, String number);
        Flowable<BaseObjectBean> removeGood(String ids);
        Flowable<ConfirmGoodBeen> confirm(String cartId, String user_curent_lng, String user_curent_lat);


    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onAddCarSuccess(ConfirmGoodBeen bean);
        void onShopCarListSuccess(ShopCarListBeen bean);
        void onUpdateCarNumSuccess(BaseObjectBean bean, int number, int one_position, int position);
        void onRemoveGoodSuccess(BaseObjectBean bean, String good_id, int position,boolean isAll);
        void onConfirmSuccess(ConfirmGoodBeen bean);
        void onInitSearchSuccess(ShopSearchBeen bean);

        /**
         * 刷新完成
         */
        void finishRefresh();

        /**
         * 加载完成
         */
        void finishLoadMore();
    }

    interface Presenter {
        /**
         */
        void addCar(String is_new, String uniqueId, String productId, String cartNum);
        void shopCarList(String store_id, String index_status);
        void updateCarNum(String id, int number, int one_position, int position);
        void removeGood(String ids, String good_id, int position,boolean isAll);

        void confirm(String cartId, String user_curent_lng, String user_curent_lat);

        void initSearchData(boolean isRefresh,boolean isLoading,String lng, String lat,String sid,String page,String limit,String index_status,String is_store,String store_id,String keyword,String priceOrder,String salesOrder,String news);


    }
}
